home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1997 September
/
Macworld (1997-09).dmg
/
Shareware World
/
Info
/
For Developers
/
DR2.1update3
/
install_shlibs
< prev
next >
Wrap
Text File
|
1997-06-28
|
6KB
|
208 lines
#!/bin/sh
# Feel free to browse and modify this script to suit your needs - ghc
LIST1="
glibc-0.961212-1N.ppc.rpm\
ldconfig-1.8.1-3B.ppc.rpm\
"
RPM="\
rpm-2.3.11-1C.ppc.rpm\
"
LIST2="\
glibc-static-0.961212-1N.ppc.rpm\
glibc-devel-0.961212-1N.ppc.rpm\
kernel-headers-2.0.28-1D.ppc.rpm\
"
LIST3="\
glibc-info-0.961212-1N.ppc.rpm\
rpm-devel-2.3.11-1C.ppc.rpm\
libtermcap-2.0.8-4B.ppc.rpm\
libtermcap-devel-2.0.8-4B.ppc.rpm\
ncurses-1.9.9e-4B.ppc.rpm\
gcc-2.7.2-2J.ppc.rpm\
gcc-c++-2.7.2-2J.ppc.rpm\
gcc-objc-2.7.2-2J.ppc.rpm\
binutils-2.7-1E.ppc.rpm\
libg++-2.7.1.4-4F.ppc.rpm\
libg++-devel-2.7.1.4-4F.ppc.rpm\
ncurses-devel-1.9.9e-4B.ppc.rpm\
gdbm-1.7.3-8B.ppc.rpm\
gdbm-devel-1.7.3-8B.ppc.rpm\
cracklib-2.5-1C.ppc.rpm\
cracklib-dicts-2.5-1C.ppc.rpm\
pwdb-0.54-3B.ppc.rpm\
pamconfig-0.51-2B.ppc.rpm\
pam-0.57-2E.ppc.rpm\
util-linux-2.5-38D.ppc.rpm\
sh-utils-1.16-4B.ppc.rpm\
tcp_wrappers-7.5-1B.ppc.rpm\
NetKit-B-0.08-13C.ppc.rpm\
procps-1.01-5D.ppc.rpm\
getty_ps-2.0.7h-1B.ppc.rpm\
bash-1.14.6-2B.ppc.rpm\
csh-5.2.6-5B.ppc.rpm\
fileutils-3.16-2B.ppc.rpm\
grep-2.0-5B.ppc.rpm\
gzip-1.2.4-7B.ppc.rpm\
hfsutils-2.0-1B.ppc.rpm\
less-321-3C.ppc.rpm\
make-3.75-1B.ppc.rpm\
net-tools-1.32.alpha-2B.ppc.rpm\
pax-1.0-1B.ppc.rpm\
psmisc-11-4B.ppc.rpm\
sed-2.05-6B.ppc.rpm\
tcsh-6.06-10B.ppc.rpm\
SysVinit-2.64-8B.ppc.rpm\
"
FILE_LIST="$LIST1 $RPM $LIST2 $LIST3"
echo "Checking to ensure that you are running this script as root..."
if [ "`id -un`" != "root" ] ; then
echo " Uhoh, you must run this script as the superuser"
echo " Please log in as \"root\" and try again."
exit
fi
echo "Checking to ensure that you have the RPMS/ppc directory..."
if [ ! -d RPMS ] ; then
echo " Uhoh, there is no RPMS directory here."
echo " You need to run this script from the directory above the RPMS"
echo " directory."
echo " The RPMS directory should contain the ppc directory."
echo " The RPMS/ppc directory contains all the RPM package files"
echo " for this update."
exit
fi
if [ ! -d RPMS/ppc ] ; then
echo " Uhoh, there is no RPMS/ppc directory."
echo " There is an RPMS directory, good. But there is no"
echo " ppc directory in it."
echo " The RPMS directory should contain the ppc directory."
echo " The RPMS/ppc directory contains all the RPM package files"
echo " for this update."
exit
fi
cd RPMS/ppc
echo "Checking to ensure that all the needed RPMs are present..."
for i in $FILE_LIST ; do
if [ ! -r "$i" ] ; then
MISSING="$MISSING $i"
fi
done
if [ "$MISSING" != "" ] ; then
echo " Uhoh, some of the necessary RPM files are not present in the"
echo " RPMS/ppc directory. Here is a list of missing RPM packages:"
for i in $MISSING ; do
echo " $i"
done
echo " You need to locate the missing RPM package files and place"
echo " them in the RPMS/ppc directory. Then rerun this script."
exit
fi
echo "----------------------------------------------------------------------"
echo "Good, everything seems to be here. The next step is to install"
echo "basic shared library support."
echo ""
echo "Although they probably wont, the next few steps could ruin"
echo "your MkLinux installation. If there is any data on your system"
echo "that you havent backed up, and you would miss if your system"
echo "became unusable, please quit out of this script and take care"
echo "of your data."
echo ""
echo "This script will not proceed until you type \"yes\" (the whole word)"
echo "at the following prompt. Any other response (including just a"
echo "carriage return) will terminate the script."
echo ""
echo "Please read the following question carefully."
echo ""
echo -n "Do you want to proceed with the shared library installation? "
read answer
if [ "$answer" != "yes" -a "$answer" != "YES" ] ; then
echo ""
echo "You did not answer \"yes\", therefore, this script is terminating."
echo "When you are ready, please run this script again and type \"yes\""
echo "at the above prompt."
exit
fi
echo ""
echo "Okay. Now proceeding with the installation of shared libraries."
echo "Installing a few core packages..."
rpm -ihv --force --nodeps $LIST1 2>/dev/null
echo ""
echo "Now creating your /etc/ld.so.conf file..."
cat > /etc/ld.so.conf <<END
/lib
/usr/lib
/usr/X11/lib
/usr/local/lib
END
echo "Now running the ldconfig command to build your cache..."
ldconfig
echo "Okay, basic shared library support has been installed."
echo "Installing a new version of rpm..."
rpm -ihv --force --nodeps $RPM
echo "Reinitializing the RPM database..."
rm -f /var/lib/rpm/*
rpm --initdb
echo "...and repopulating it with the packages we _just_ installed."
rpm -i --nodeps --force $LIST1 $RPM 2> /dev/null
echo "Now installing the rest of the shared library based packages in this update..."
# The options --force and --nodeps are not required for EVERY package in
# LIST2 and LIST3, just for a few of them. However, I have put those options
# on so that things will complete smoothly. Granted, the RPM database is
# a little incomplete now, but it is in pretty good shape. It will only
# get better as future updates replace old files with shared lib versions.
# Installing LIST2 is noisy, so send the complaints to /dev/null
rpm -ihv --force --nodeps $LIST2 2> /dev/null
for i in $LIST3 ; do
rpm -ihv --force --nodeps $i
done
# Now do some hackery to fix up some problems with the install
# link for /usr/lib/libncurses.so.2.0 seems to be missing
ln -s libncurses.so.1.9.9e /usr/lib/libncurses.so.2.0
# glibc created bunches of rpmsave and rpmorig files of things that
# really are not configuration files. We will remove them.
find /lib /usr/bin /usr/include /usr/lib -depth -print \
| egrep "\.(rpmsave|rpmorig)$" \
| xargs rm -rf
echo "----------------------------------------------------------------------"
echo "The DR2.1update3 portion of shared library installation is complete."
echo ""
echo "The next thing to do is to reboot your MkLinux system."
echo ""
echo "Note: the commands "shutdown" and "reboot" will not work this one"
echo "time, because part of this installation changed a few files needed"
echo "in the shutdown process. Do not worry, just press the key sequence"
echo "Control-Apple-Power, and your system will come back up."
sync ; sleep 1 ; sync